package ruleta_wicket.ruleta_wicket;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.data.DataView;
import org.apache.wicket.markup.repeater.data.IDataProvider;
import org.apache.wicket.markup.repeater.data.ListDataProvider;

import domain.Bet;
import domain.DirectBet;
import domain.Player;
import domain.Table;

public class TableroPanel extends Panel {
	
	public TableroPanel(String id) {
		super(id);

		DataView<Bet> listBet = this.detallesApuesta(); 
		this.tituloDeLosCamposDeLaLista(); 
		this.add(listBet); 
	}
	
	public DataView<Bet> detallesApuesta(){
		Table mesa = WicketApplication.getApplication().getTable(); 
		
		ListDataProvider listaDeApuestas = new ListDataProvider (mesa.getActualBets()); 
		DataView<Bet> lista =  new DataView<Bet>("detalleApuesta", listaDeApuestas){
			public void populateItem(final Item item){
				item.add(new Label("getDescription()"));
				item.add(new Label("count"));
				item.add(new Label("player"));		
			}
		}; 
		return lista; 
	}
	
	public void tituloDeLosCamposDeLaLista(){
		this.add(new Label("TipoApuesta","Tipo     "));
		this.add(new Label("CantidadApostada","Amount     "));
		this.add(new Label("Jugador","Player     "));
	}
}
